import { Inject, Injectable, OnModuleInit } from '@nestjs/common';
import {type ClientGrpc } from '@nestjs/microservices';



@Injectable()
export class AppService  {
  // private emailService: email.EmailService;
  // constructor(@Inject('EMAIL_PACKAGE') private emailCLIENT: ClientGrpc) {}
  // onModuleInit(): any {
  //   this.emailService = this.emailCLIENT.getService<email.EmailService>('EmailService');
  // }
  //
  // sendWelcomeEmail(data:SendEmailRequest){
  //   return this.emailService.send(data);
  // }
  // private userService: user.UserService;
  //
  // constructor(@Inject('USER_PACKAGE') private userCLIENT: ClientGrpc) {}
  // onModuleInit(): any {
  //   this.userService = this.userCLIENT.getService<user.UserService>('UserService');
  // }
  //
  // getUser(id: number): Observable<user.User> {
  //   return this.userService.findOne({ id });
  // }
  //
  // getMany(): Observable<user.User[]> {
  //   const ids$ = new ReplaySubject<user.UserById>();
  //   ids$.next({ id: 1 })
  //   ids$.next({ id: 2 })
  //   ids$.next({ id: 3 })
  //   ids$.next({ id: 4 })
  //   ids$.complete()
  //   const stream$ = this.userService.findMany(ids$.asObservable());
  //   return stream$.pipe(toArray());
  // }
}
